package com.ruoyi.procurementmanagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.procurementmanagement.mapper.ErpGoodsLabelMapper;
import com.ruoyi.procurementmanagement.domain.ErpGoodsLabel;
import com.ruoyi.procurementmanagement.service.IErpGoodsLabelService;

/**
 * 商品标签Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-31
 */
@Service
public class ErpGoodsLabelServiceImpl implements IErpGoodsLabelService
{
    @Autowired
    private ErpGoodsLabelMapper erpGoodsLabelMapper;

    /**
     * 查询商品标签
     *
     * @param id 商品标签主键
     * @return 商品标签
     */
    @Override
    public ErpGoodsLabel selectErpGoodsLabelById(Integer id)
    {
        return erpGoodsLabelMapper.selectErpGoodsLabelById(id);
    }

    /**
     * 查询商品标签列表
     *
     * @param erpGoodsLabel 商品标签
     * @return 商品标签
     */
    @Override
    public List<ErpGoodsLabel> selectErpGoodsLabelList(ErpGoodsLabel erpGoodsLabel)
    {
        return erpGoodsLabelMapper.selectErpGoodsLabelList(erpGoodsLabel);
    }

    /**
     * 新增商品标签
     *
     * @param erpGoodsLabel 商品标签
     * @return 结果
     */
    @Override
    public int insertErpGoodsLabel(ErpGoodsLabel erpGoodsLabel)
    {
        erpGoodsLabel.setCreateTime(DateUtils.getNowDate());
        return erpGoodsLabelMapper.insertErpGoodsLabel(erpGoodsLabel);
    }

    /**
     * 修改商品标签
     *
     * @param erpGoodsLabel 商品标签
     * @return 结果
     */
    @Override
    public int updateErpGoodsLabel(ErpGoodsLabel erpGoodsLabel)
    {
        erpGoodsLabel.setUpdateTime(DateUtils.getNowDate());
        return erpGoodsLabelMapper.updateErpGoodsLabel(erpGoodsLabel);
    }

    /**
     * 批量删除商品标签
     *
     * @param ids 需要删除的商品标签主键
     * @return 结果
     */
    @Override
    public int deleteErpGoodsLabelByIds(Integer[] ids)
    {
        return erpGoodsLabelMapper.deleteErpGoodsLabelByIds(ids);
    }

    /**
     * 删除商品标签信息
     *
     * @param id 商品标签主键
     * @return 结果
     */
    @Override
    public int deleteErpGoodsLabelById(Integer id)
    {
        return erpGoodsLabelMapper.deleteErpGoodsLabelById(id);
    }

    @Override
    public List<ErpGoodsLabel> selectLabelsByGoodsId(Long goodsId) {
        return erpGoodsLabelMapper.selectLabelsByGoodsId(goodsId);
    }
}
